package com.bl.student.common.enums;

import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * Created by yujingyi on 2017/9/19.
 */
@Getter
@AllArgsConstructor
public enum BizModule {

    NORMAL("NORMAL", "普通推送消息"),
    NOTIFICATION("NOTIFICATION", "消息通知"),
    ACTIVITY_INVITED("ACTIVITY_INVITED", "活动邀请");

    private String module;
    private String name;

    private static Map<String, BizModule> enumMap = Maps.newHashMap();
    static {
        for (BizModule item : values()) {
            enumMap.put(item.module, item);
        }
    }

    public static BizModule fromValue(String module) {
        BizModule item = enumMap.get(module);
        return item;
    }
}
